package August;

import java.util.Scanner;

class ListNode{
    public int val;
    public ListNode next;
    public ListNode(int val){
        this.val = val;
    }
}
public class Day0810 {
    //反转部分单向链表
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            //单链表的长度
            int n = scanner.nextInt();

        }
    }


    //猴子分桃
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            if (n == 0){
                break;
            }else {
                long nums = (long) Math.pow(5,n) - 4;
                long count = (long) Math.pow(4,n) - 4 + n;
                System.out.println(nums + " "+count);
            }
        }
    }
}

